define(["backbone", "_template", "jquery", "_cartData", "_base", "_global", "layer_m", "_queryConditions", "qrcode"],
    function (Backbone, template, $, _CD, _base, _gl, layer,_qc, QRCode) {
    return Backbone.View.extend({
        el: '#pageSwitch',
        eventType:"click",
        events: {
            //"click #sweepPay": "sweepPay",
            //"click #helpBuy": "helpBuy"
        },
        initialize: function (opts) {
             
        },
        render: function (opts) {
            var goodsAllBuy = _CD.getAllBuy();
            var data = {
                data:goodsAllBuy
            };
            var totalPrice = 0;
            var totalNumb = 0;
            for (var i = 0, len = goodsAllBuy.length; i < len; i++) {
                totalPrice = _base.accAdd(totalPrice, _base.accMul(parseFloat(goodsAllBuy[i].numb), parseFloat(goodsAllBuy[i].price)));
                totalNumb += parseInt(goodsAllBuy[i].numb);
            }
            data.totalPrice = totalPrice;
            data.totalNumb = totalNumb;
            this.totalPrice = totalPrice;
            var tHtml = template("templateOrder", data);
            $(this.el).html(tHtml);
        },
       
        // 批量清除定时器
        clearTimer: function () {
            if (!!window.scanCountdownTimer) {
                clearInterval(scanCountdownTimer);
            }
            if (!!window.getValidateCodeTimer) {
                clearInterval(getValidateCodeTimer);
            }
            if (!!window.payCountdownTimer) {
                clearInterval(window.payCountdownTimer);
            }
            if (!!window.gotoHomeTimer) {
                clearInterval(window.gotoHomeTimer);
            }
        }
    });
});